package com.dishdex.menuhub.module.utils;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 * ClassName:
 * Package: com.dishdex.menuhub.module.utils
 * Description:
 *
 * @Author:
 * @Create 2025/10/20 10:56
 * @Version 1.0
 */
@Data
@Accessors(chain = true)
public class Response<T> {
    private final ResponseStatus status = new ResponseStatus();
    private final T result;

    public Response(int status) {
        this.status.setCode(status);
        this.status.setMsg(ResponseCode.getMsg(status));
        this.result = null;
    }

    public Response(int status, T result) {
        this.status.setCode(status);
        this.status.setMsg(ResponseCode.getMsg(status));
        this.result = result;
    }
}
